<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Ad\Advert;
use App\Models\Shop\Product;
use JWTAuth;

class HomeController extends Controller
{
    public function index()
    {
        $slides = Advert::where('category_id', '6')->orderBy("sort_order")->get();
        $banners = Advert::where('category_id', '7')->orderBy("sort_order")->get();
        $products = Product::where('is_onsale', 1)->orderBy('sort_order')->limit(4)->get();
            return compact('slides','banners','products');
    }
}
